package com.roy.workbench.bookmark.domain;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * Created by admin on 17-12-5.
 */
@Entity
@Table(name = "bm_bookmark")
public class Bookmark extends BaseEntity {
    private String icon;

    private String title;

    @Column(nullable = false)
    private String url;

    @Column(nullable = false)
    private String describe;

    private String note;

    @ManyToOne(cascade = {CascadeType.MERGE})
    @JoinColumn(name = "catalog_id",referencedColumnName = "id")
    private Catalog catalog;

    @ManyToMany(cascade = CascadeType.ALL)
    @JoinTable(name = "bm_bookmark_tag",
            joinColumns = {@JoinColumn(name = "bookmark_id", referencedColumnName = "id")},
            inverseJoinColumns = {@JoinColumn(name = "tag_id", referencedColumnName = "id")})
    private List<Tag> tags;

    @Transient
    private int flag;

    public Long getId() {
        return id;
    }

    public Catalog getCatalog() {
        return catalog;
    }

    public void setCatalog(Catalog catalog) {
        this.catalog = catalog;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public void setTags(List<Tag> tags) {
        this.tags = tags;
    }
}
